import { ref, watch } from 'vue'
export default function () {
  let num = ref(1)

  let stopNum = watch(
    num,
    (newVal, oldVal) => {
      console.log('num', newVal, oldVal)
      if (num.value > 10) stopNum()
    },
    {
      // deep: true,
      immediate: true,
    }
  )
  let changeNum = () => {
    num.value += 1
  }
  return { num, changeNum }
}
